import React, { Component } from 'react'
import { HashRouter as Router, Route } from 'react-router-dom'

import Tabbar from './components/tabbar'
import Cart from './components/cart/cart'
import Home from './components/home/home'
import My from './components/my/my'
import Category from './components/category/category'
import SearchCenter from './components/searchCenter/searchCenter'
import GoodList from './components/goodList/GoodList'
import GoodDetail from './components/goodDetail/GoodDetail'
import Pay from './components/pay/Pay'

export default class RouterConfig extends Component {
    render() {
        return (
            <Router>
                <Route path='/' exact render={(props) => <Tabbar {...props}><Home></Home></Tabbar>}></Route>
                <Route path='/cart' exact render={(props) => <Tabbar {...props}><Cart></Cart></Tabbar>}></Route>
                <Route path='/my' exact render={(props) => <Tabbar {...props}><My></My></Tabbar>}></Route>
                <Route path='/category' exact render={(props) => <Tabbar {...props}><Category></Category></Tabbar>}></Route>
                <Route path="/searchCenter" exact render={() => <SearchCenter></SearchCenter>}></Route>
                <Route path="/goodList" exact render={(props) => <GoodList {...props}></GoodList>}></Route>
                <Route path="/goodDetail/:goods_id" exact render={(props) => <GoodDetail {...props}></GoodDetail>}></Route>
                <Route path='/pay' exact render={() => <Pay></Pay>}></Route>
            </Router>
        )
    }
}
